class Animal(object):
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def eat(self):
        print(f"{self.name}吃东西")

    def sleep(self):
        print(f"{self.name}要睡觉")


class Cat(Animal):
    def eat(self):
        """覆盖式重写 吃方法"""
        print(f"{self.name}喜欢吃鱼")

# 创建对象
tom = Cat("汤姆", 3)
tom.eat()



